package com.book.book.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

import com.book.book.dao.CommunicateDao;
import com.book.book.domain.CommunicateDO;
import com.book.book.service.CommunicateService;


@Service
public class CommunicateServiceImpl implements CommunicateService {
    @Autowired
    private CommunicateDao communicateDao;

    @Override
    public CommunicateDO get(Integer id) {
        return communicateDao.get(id);
    }

    @Override
    public List<CommunicateDO> list(Map<String, Object> map) {
        return communicateDao.list(map);
    }

    @Override
    public int count(Map<String, Object> map) {
        return communicateDao.count(map);
    }

    @Override
    public int save(CommunicateDO communicate) {
        return communicateDao.save(communicate);
    }

    @Override
    public int update(CommunicateDO communicate) {
        return communicateDao.update(communicate);
    }

    @Override
    public int remove(Integer id) {
        return communicateDao.remove(id);
    }

    @Override
    public int batchRemove(Integer[] ids) {
        return communicateDao.batchRemove(ids);
    }

    /**
     * 获取这本书的所有评论
     *
     * @return
     */
    @Override
    public List<CommunicateDO> getcommunicate(Integer bookid) {
        return communicateDao.getcommunicate(bookid);
    }

    @Override
    public List<CommunicateDO> listWithName(Map<String, Object> map) {
        return communicateDao.listWithName(map);
    }
}
